<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Setting Up The Web Interface</title>

<STYLE type="text/css">
<!--
        .Default { font-family: verdana,arial,serif; font-size: 8pt; }
        .PageTitle { font-family: verdana,arial,serif; font-size: 12pt; font-weight: bold; }
-->      
</STYLE>

</head>

<body bgcolor="#FFFFFF" text="black" class="Default">

<p>
<div align="center">
<h2 class="PageTitle">Setting Up The Web Interface</h2>
</div>
</p>
<hr>


<p>
<strong><u>Notes</u></strong>
</p>

<p>
In these instructions I will assume that you are running the <a href="http://www.apache.org">Apache</a> web server on your machine.  If you are using some other web server, you'll have to make changes where appropriate.  I am also assuming that you used the <i>/usr/local/nagios</i> as the installation prefix.
</p>

<p>
<strong><u>Sample Configuration</u></strong>
</p>
<p>
A sample Apache config file snippet is created when you run the configure script - you can find the sample config file (named <i>httpd.conf</i>) in the <i>sample-config/</i> subdirectory of the Nagios distribution.  You will need to add the contents of this file to your Apache configuration files before you can access the Nagios web interface.  The instructions found below detail how to manually add the appropriate configuration entries to Apache.
</p>

<p>
<strong><u>Configure Aliases and Directory Options For The Web Interface</u></strong>
</p>

<p>
First you'll need to create appropriate entries for the Nagios web interface (HTML and CGIs) in your web server config file. Add the following snippet to your web server configuration file (i.e. <b>httpd.conf</b>), changing it to match any directory differences on your system.
</p>

<strong>
<font color="red">
<pre>
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin

&lt;Directory "/usr/local/nagios/sbin"&gt;
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    Require valid-user
&lt;/Directory&gt;

Alias /nagios /usr/local/nagios/share

&lt;Directory "/usr/local/nagios/share"&gt;
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    Require valid-user
&lt;/Directory&gt;
</pre>
</font>
</strong>

<p>
<strong>Note:</strong>  The default Nagios installation expects to find the HTML files and CGIs at <b>http://yourmachine/nagios/</b> and <b>http://yourmachine/nagios/cgi-bin/</b>, respectively.  These locations can be changed using the <b>--with-htmurl</b> and <b>--with-cgiurl</b> options in the configure script.
</p>

<p>
<strong>Important!</strong>  If you are installing Nagios on a multi-user system, you may want use <a href="http://cgiwrap.unixtools.org/">CGIWrap</a> to provide additional security between the CGIs and the <a href="commandfile.html">external command file</a>.  If you decide to use CGIWrap, the ScriptAlias you'll end up using will most likely be different from that mentioned above.  More information on doing this can be found <a href="security.html">here</a>.
</p>

<p>
<strong><u>Restart The Web Server</u></strong>
</p>

<p>
Once you've finished editing the Apache configuration file, you'll need to restart the web server with a command like this...
</p>

<p>
<strong>
<font color="red">
/etc/rc.d/init.d/httpd restart
</font>
</strong>
</p>

<p>
<strong><u>Configure Web Authentication</u></strong>
</p>

<p>
Once you have installed the web interface properly, you'll need to specify who can access the Nagios web interface.  Follow <a href="cgiauth.html">these instructions</a> to do this.
</p>

<p>
<strong><u>Verify Your Changes</u></strong>
</p>

<p>
Don't forget to check and see if the changes you made to Apache work.  You should be able to point your web browser at <b>http://yourmachine/nagios/</b> and get the web interface for Nagios.  The CGIs may not display any information, but this will be remedied once you configure everything and start Nagios.
</p>

<hr>

</body>
</html>
